﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ObjectModel.Customer>>" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


<ext:ResourceManager runat="server" />
        
<ext:GridPanel runat="server" ID="grd" Height="400" Frame="true" AutoExpandColumn="Name" Layout="FitLayout"
    Title="ViewPage1" >
    <Store>
        <ext:Store runat="server" >
            <Reader>
                <ext:JsonReader IDProperty="Id">
                    <Fields>
			<ext:RecordField Name="Name" />
				<ext:RecordField Name="CorporateName" />
				<ext:RecordField Name="Tel" />
				<ext:RecordField Name="Cel" />
				<ext:RecordField Name="Email" />
				<ext:RecordField Name="Street" />
				<ext:RecordField Name="Complement" />
				<ext:RecordField Name="CEP" />
				<ext:RecordField Name="Neighbourhood" />
				<ext:RecordField Name="City" />
				<ext:RecordField Name="State" />
				<ext:RecordField Name="Birthdate" />
				<ext:RecordField Name="Description" />
				<ext:RecordField Name="Document" />
				<ext:RecordField Name="MunicipalInscription" />
				<ext:RecordField Name="StateInscription" />
				<ext:RecordField Name="Removed" />
	                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    </Store>
	
	<TopBar>
        <ext:Toolbar ID="Toolbar" runat="server">
			<Items>
				<ext:Button runat="server" ID="btnNovo" OnClientClick="window.location = 'Customer/Create';" Text="Novo">
				</ext:Button>
			</Items>
        </ext:Toolbar>
	</TopBar>

	<ColumnModel runat="server">
        <Columns>
            <ext:Column DataIndex="Name" Header="Name" />
	            <ext:Column DataIndex="CorporateName" Header="CorporateName" />
	            <ext:Column DataIndex="Tel" Header="Tel" />
	            <ext:Column DataIndex="Cel" Header="Cel" />
	            <ext:Column DataIndex="Email" Header="Email" />
	            <ext:Column DataIndex="Street" Header="Street" />
	            <ext:Column DataIndex="Complement" Header="Complement" />
	            <ext:Column DataIndex="CEP" Header="CEP" />
	            <ext:Column DataIndex="Neighbourhood" Header="Neighbourhood" />
	            <ext:Column DataIndex="City" Header="City" />
	            <ext:Column DataIndex="State" Header="State" />
	            <ext:Column DataIndex="Birthdate" Header="Birthdate" />
	            <ext:Column DataIndex="Description" Header="Description" />
	            <ext:Column DataIndex="Document" Header="Document" />
	            <ext:Column DataIndex="MunicipalInscription" Header="MunicipalInscription" />
	            <ext:Column DataIndex="StateInscription" Header="StateInscription" />
	            <ext:Column DataIndex="Removed" Header="Removed" />
	<ext:CommandColumn Width="80">
    <Commands>
        <ext:GridCommand Icon="ArrowDown">
            <Menu EnableScrolling="false">
                <Items>
					<ext:MenuCommand Text="Editar" Icon="ArrowRight" CommandName="Edit" />
					<ext:MenuCommand Text="Detalhes" Icon="ArrowRight" CommandName="Details" />
					<ext:MenuCommand Text="Excluir" Icon="ArrowRight" CommandName="Delete" />
                </Items>
            </Menu>
            <ToolTip Text="Menu" />
        </ext:GridCommand>
    </Commands>
</ext:CommandColumn>
		</Columns>
    </ColumnModel>
    <SelectionModel>
        <ext:RowSelectionModel runat="server" />
    </SelectionModel>
    <Listeners>
        <Command Handler="window.location = command+'/'+record.data.Id"/>
    </Listeners>
    <BottomBar>
        <ext:PagingToolbar ID="PagingToolbar" runat="server" PageSize="10">
        </ext:PagingToolbar>
    </BottomBar>
</ext:GridPanel>
<% grd.GetStore().DataSource =  Model;%>




</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>

